//
//  LGRetSweetView.m
//  微博
//
//  Created by MS on 15-12-14.
//  Copyright (c) 2015年 MS. All rights reserved.
//

#import "LGRetSweetView.h"
#import "LGPhotosView.h"
@interface LGRetSweetView ()

//昵称
@property (nonatomic,weak) UILabel * nameView ;


//正文
@property (nonatomic,weak) UILabel * contentView ;

//配图
@property (nonatomic,weak)LGPhotosView * photosView ;
@end

@implementation LGRetSweetView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self setUpAllsubView];
        self.userInteractionEnabled = YES;
        self.image = [UIImage imageResizingWithName:@"timeline_retweet_background"];
    }
    return self;
}



-(void)setUpAllsubView
{
    //昵称
    UILabel * nameView = [[UILabel alloc] init];
    nameView.textColor = [UIColor colorWithRed:0.11f green:0.55f blue:0.75f alpha:1.00f];
    [self addSubview:nameView];
    nameView.font = LGNameFont;
    _nameView = nameView;
    
    
    //正文
    UILabel * contentView = [[UILabel alloc] init];
    [self addSubview:contentView];
    contentView.font = LGTextFont;
    contentView.numberOfLines =0;
    _contentView = contentView;

    //配图
    LGPhotosView * phontosView = [[LGPhotosView alloc] init];
    [self addSubview:phontosView];
    _photosView = phontosView;
}


-(void)setStatusF:(LGStutaesFrame *)statusF
{
    _statusF = statusF;
    LGStatus *status = statusF.statues;
    
    // 昵称
    _nameView.frame = statusF.retSweetNameFrame;
    _nameView.text = status.retweeted_status.user.name;
    
    // 正文
    _contentView.frame = statusF.retSweetContentFrame;
    _contentView.text =status.retweeted_status.text ;
    
    //配图
    _photosView.frame = statusF.retSweetPhontosFrame;
    _photosView.pic_urls = status.retweeted_status.pic_urls;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
